/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Services;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import models.Account;

/**
 *
 * @author samus
 */
@Stateless
public class AccountServiceBean {
    
    @PersistenceContext
    private EntityManager em;
    
    public Account CreateOrUpdate(Account account) {
        return em.merge(account);
    }
    
    public void remomve(Account account) {
        em.remove(em.merge(account));
    }
    
    public Account find(Object id) {
        return em.find(Account.class, id);
    }
}
